<?php
 Session_Start () ;
 Include ("../../include/garennes.cfg") ;
 Include ("../../include/init.php") ;
 Include ("../include/config.inc") ;
 verif_droits ($droit_courant, $_SESSION ["code"]) ;
 
 $changement = var_courante ("changement", 0, null) ;
 
 If (IsSet ($changement))
  {
   $millesime = millesime (0) ;
   If ($changement == 1)
    {
     $c1 = var_courante ("c1", 0, null) ; If (IsSet ($c1) And ($c1 == 1)) { $ok = SQL_commande ("UPDATE appreciations SET millesime='".$millesime."'", $id_sql) ; }
     $c2 = var_courante ("c2", 0, null) ; If (IsSet ($c2) And ($c2 == 1)) { $ok = SQL_commande ("UPDATE autorisations SET millesime='".$millesime."'", $id_sql) ; }
     $c3 = var_courante ("c3", 0, null) ; If (IsSet ($c3) And ($c3 == 1)) { $ok = SQL_commande ("UPDATE calcul_moyenne SET millesime='".$millesime."'", $id_sql) ; }
     //$c4 = var_courante ("c4", 0, null) ; If (IsSet ($c4) And ($c4 == 1)) { $ok = SQL_commande ("UPDATE classe_virtuelle SET millesime='".$millesime."'", $id_sql) ; }
     $c5 = var_courante ("c5", 0, null) ; If (IsSet ($c5) And ($c5 == 1)) { $ok = SQL_commande ("UPDATE classement SET millesime='".$millesime."'", $id_sql) ; }
     $c6 = var_courante ("c6", 0, null) ; If (IsSet ($c6) And ($c6 == 1)) { $ok = SQL_commande ("UPDATE classes SET millesime='".$millesime."'", $id_sql) ; }
     $c7 = var_courante ("c7", 0, null) ; If (IsSet ($c7) And ($c7 == 1)) { $ok = SQL_commande ("UPDATE configuration SET millesime='".$millesime."'", $id_sql) ; }
     $c8 = var_courante ("c8", 0, null) ; If (IsSet ($c8) And ($c8 == 1)) { $ok = SQL_commande ("UPDATE controles SET millesime='".$millesime."'", $id_sql) ; }
     $c9 = var_courante ("c9", 0, null) ; If (IsSet ($c9) And ($c9 == 1)) { $ok = SQL_commande ("UPDATE disciplines SET millesime='".$millesime."'", $id_sql) ; }
     $c10 = var_courante ("c10", 0, null) ; If (IsSet ($c10) And ($c10 == 1)) { $ok = SQL_commande ("UPDATE eleves SET millesime='".$millesime."'", $id_sql) ; }
     $c11 = var_courante ("c11", 0, null) ; If (IsSet ($c11) And ($c11 == 1)) { $ok = SQL_commande ("UPDATE etablissements SET millesime='".$millesime."'", $id_sql) ; }
     $c12 = var_courante ("c12", 0, null) ; If (IsSet ($c12) And ($c12 == 1)) { $ok = SQL_commande ("UPDATE groupes_classe SET millesime='".$millesime."'", $id_sql) ; }
     $c13 = var_courante ("c13", 0, null) ; If (IsSet ($c13) And ($c13 == 1)) { $ok = SQL_commande ("UPDATE groupes_eleve SET millesime='".$millesime."'", $id_sql) ; }
     $c14 = var_courante ("c14", 0, null) ; If (IsSet ($c14) And ($c14 == 1)) { $ok = SQL_commande ("UPDATE groupes_utilisateurs SET millesime='".$millesime."'", $id_sql) ; }
     $c15 = var_courante ("c15", 0, null) ; If (IsSet ($c15) And ($c15 == 1)) { $ok = SQL_commande ("UPDATE interdictions SET millesime='".$millesime."'", $id_sql) ; }
     $c16 = var_courante ("c16", 0, null) ; If (IsSet ($c16) And ($c16 == 1)) { $ok = SQL_commande ("UPDATE memo_notes SET millesime='".$millesime."'", $id_sql) ; }
     $c17 = var_courante ("c17", 0, null) ; If (IsSet ($c17) And ($c17 == 1)) { $ok = SQL_commande ("UPDATE moyennes SET millesime='".$millesime."'", $id_sql) ; }
     $c18 = var_courante ("c18", 0, null) ; If (IsSet ($c18) And ($c18 == 1)) { $ok = SQL_commande ("UPDATE notes SET millesime='".$millesime."'", $id_sql) ; }
     $c19 = var_courante ("c19", 0, null) ; If (IsSet ($c19) And ($c19 == 1)) { $ok = SQL_commande ("UPDATE options_eleve SET millesime='".$millesime."'", $id_sql) ; }
     $c20 = var_courante ("c20", 0, null) ; If (IsSet ($c20) And ($c20 == 1)) { $ok = SQL_commande ("UPDATE periodes_classe SET millesime='".$millesime."'", $id_sql) ; }
     $c21 = var_courante ("c21", 0, null) ; If (IsSet ($c21) And ($c21 == 1)) { $ok = SQL_commande ("UPDATE services_classe SET millesime='".$millesime."'", $id_sql) ; }
     $c22 = var_courante ("c22", 0, null) ; If (IsSet ($c22) And ($c22 == 1)) { $ok = SQL_commande ("UPDATE services_prof SET millesime='".$millesime."'", $id_sql) ; }
     //$c23 = var_courante ("c23", 0, null) ; If (IsSet ($c23) And ($c23 == 1)) { $ok = SQL_commande ("UPDATE simulation_coefficients SET millesime='".$millesime."'", $id_sql) ; }
     $c24 = var_courante ("c24", 0, null) ; If (IsSet ($c24) And ($c24 == 1)) { $ok = SQL_commande ("UPDATE sous_matieres SET millesime='".$millesime."'", $id_sql) ; }
     //$c25 = var_courante ("c25", 0, null) ; If (IsSet ($c25) And ($c25 == 1)) { $ok = SQL_commande ("UPDATE type_classe_virtuelle SET millesime='".$millesime."'", $id_sql) ; }
     $c26 = var_courante ("c26", 0, null) ; If (IsSet ($c26) And ($c26 == 1)) { $ok = SQL_commande ("UPDATE types_examens SET millesime='".$millesime."'", $id_sql) ; }
     $c27 = var_courante ("c27", 0, null) ; If (IsSet ($c27) And ($c27 == 1)) { $ok = SQL_commande ("UPDATE types_periode SET millesime='".$millesime."'", $id_sql) ; }
     $c28 = var_courante ("c28", 0, null) ; If (IsSet ($c28) And ($c28 == 1)) { $ok = SQL_commande ("UPDATE types_regimes SET millesime='".$millesime."'", $id_sql) ; }
     $c29 = var_courante ("c29", 0, null) ; If (IsSet ($c29) And ($c29 == 1)) { $ok = SQL_commande ("UPDATE types_utilisateurs SET millesime='".$millesime."'", $id_sql) ; }
     //$c30 = var_courante ("c30", 0, null) ; If (IsSet ($c30) And ($c30 == 1)) { $ok = SQL_commande ("UPDATE utilisateurs SET millesime='".$millesime."'", $id_sql) ; }
     $c31 = var_courante ("c31", 0, null) ; If (IsSet ($c31) And ($c31 == 1)) { $ok = SQL_commande ("UPDATE vie_scolaire SET millesime='".$millesime."'", $id_sql) ; }
     
     $c32 = var_courante ("c32", 0, null) ; If (IsSet ($c32) And ($c32 == 1)) { $ok = SQL_commande ("UPDATE groupement_disciplines_attribution SET millesime='".$millesime."'", $id_sql) ; }
     $c33 = var_courante ("c33", 0, null) ; If (IsSet ($c33) And ($c33 == 1)) { $ok = SQL_commande ("UPDATE groupement_disciplines_definition SET millesime='".$millesime."'", $id_sql) ; }
    }
   $maj = 1 ;
  }

 $resultats = SQL_commande ("SELECT * FROM menus WHERE numero='".$droit_courant."' AND ordre='0' LIMIT 1", $id_sql) ;
 $l = SQL_tableau_associatif ($resultats, "") ; 
 Echo "<html><head>" ;
 entete_html ("Garennes", "travail", 1) ;
 Echo styles ("none", "none", "none", $l ["lien"], "none") ;
 Echo "</head>" ;
 
 $millesime = millesime (0) ;
 
 Echo "<BODY BACKGROUND=\"../images/fond.png\" TEXT=\"#000000\" onContextMenu=\"return false\">" ;
 Echo "<CENTER><FONT COLOR=\"#0000FF\">Gestion&nbsp;des&nbsp;tables&nbsp;mill&eacute;sim&eacute;es</FONT>" ;
 If (IsSet ($maj) ANd ($maj ==1)) { Echo "&nbsp;:&nbsp;<FONT COLOR=\"#FF0000\">Effectu&eacute;" ; }
 Echo "<BR><FONT COLOR=\"#0000FF\">Mill&eacute;sim&eacute;e&nbsp;courant&nbsp;:".millesime (0)."&nbsp;</FONT></CENTER><BR>" ;
 Echo "<FORM ACTION=\"./utilitaire_millesime.php\" METHOD=\"POST\">" ;
 Echo "<input type=\"hidden\" name=\"changement\" value=\"1\">" ;
 Echo "<TABLE BORDER=\"1\" CELLPADDING=\"0\" CELLSPACING=\"0\" ALIGN=\"CENTER\" STYLE=\"border:1px solid #000000;border-collapse:collapse\">" ;
 Echo "<TR><TD><TABLE BGCOLOR=\"".$l ["couleur_fond"]."\" BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">" ;
 Echo "<TR BGCOLOR=\"".$l ["lien"]."\"><TD ALIGN=\"CENTER\">&nbsp;<B>&nbsp;Changer&nbsp;seulement&nbsp;le&nbsp;mill&eacute;sime&nbsp;courant&nbsp;des&nbsp;tables&nbsp;suivantes&nbsp;:</B>&nbsp;</TD></TR>" ;
 Echo "<TR><TD>&nbsp;</TD></TR>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c1\" value=\"1\" checked>&nbsp;Appreciations&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c2\" value=\"1\" checked>&nbsp;Autorisations&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c3\" value=\"1\" checked>&nbsp;Calcul&nbsp;moyenne&nbsp;</td></tr>" ;
 //Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c4\" value=\"1\" checked>&nbsp;Classe_virtuelle&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c5\" value=\"1\" checked>&nbsp;Classement&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c6\" value=\"1\" checked>&nbsp;Classes&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c7\" value=\"1\" checked>&nbsp;Configuration&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c8\" value=\"1\" checked>&nbsp;Contr&ocirc;les&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c9\" value=\"1\" checked>&nbsp;Disciplines&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c10\" value=\"1\" checked>&nbsp;&Eacute;l&egrave;ves&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c11\" value=\"1\" checked>&nbsp;&Eacute;tablissements&nbsp;</td></tr>" ;
 
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c32\" value=\"1\" checked>&nbsp;Groupement&nbsp;disciplines&nbsp;attribution&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c33\" value=\"1\" checked>&nbsp;Groupement&nbsp;disciplines&nbsp;definition&nbsp;</td></tr>" ;
 
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c12\" value=\"1\" checked>&nbsp;Groupes&nbsp;classe&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c13\" value=\"1\" checked>&nbsp;Groupes&nbsp;&eacute;l&egrave;ve&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c14\" value=\"1\" checked>&nbsp;Groupes&nbsp;utilisateurs&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c15\" value=\"1\" checked>&nbsp;Interdictions&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c16\" value=\"1\" checked>&nbsp;M&eacute;mo&nbsp;notes&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c17\" value=\"1\" checked>&nbsp;Moyennes&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c18\" value=\"1\" checked>&nbsp;Notes&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c19\" value=\"1\" checked>&nbsp;Options&nbsp;&eacute;l&egrave;ve&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c20\" value=\"1\" checked>&nbsp;P&eacute;riodes&nbsp;classe&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c21\" value=\"1\" checked>&nbsp;Services&nbsp;classe&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c22\" value=\"1\" checked>&nbsp;Services&nbsp;prof&nbsp;</td></tr>" ;
 //Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c23\" value=\"1\" checked>&nbsp;Simulation&nbsp;coefficients&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c24\" value=\"1\" checked>&nbsp;Sous&nbsp;mati&egrave;res&nbsp;</td></tr>" ;
 //Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c25\" value=\"1\" checked>&nbsp;Type&nbsp;classe&nbsp;virtuelle&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c26\" value=\"1\" checked>&nbsp;Types&nbsp;examens&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c27\" value=\"1\" checked>&nbsp;Types&nbsp;p&eacute;riode&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c28\" value=\"1\" checked>&nbsp;Types&nbsp;r&eacute;gimes&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c29\" value=\"1\" checked>&nbsp;Types&nbsp;utilisateurs&nbsp;</td></tr>" ;
 //Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c30\" value=\"1\" checked>&nbsp;Utilisateurs&nbsp;</td></tr>" ;
 Echo "<tr><td>&nbsp;<input type=\"checkbox\" name=\"c31\" value=\"1\" checked>&nbsp;Vie&nbsp;scolaire&nbsp;</td></tr>" ;
 Echo "<TR><TD>&nbsp;</TD></TR>" ;
 Echo "<TR><TD ALIGN=\"CENTER\"><INPUT TYPE=IMAGE SRC=\"../images/valider.png\" BORDER=\"0\"></TD></TR>" ;
 Echo "<TR><TD>&nbsp;</TD></TR></TABLE>" ;
 Echo "</TD></TR></TABLE>" ;
 Echo "</BODY></HTML>" ;
?>